package com.njcb.ams.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.njcb.ams.interaction.BusinessDemoManager;
import com.njcb.ams.pojo.dto.AppInfoQueryRequest;
import com.njcb.ams.pojo.dto.AppInfoQueryResponse;
import com.njcb.ams.pojo.dto.standard.PageResponse;
import com.njcb.ams.store.page.Page;
import com.njcb.ams.store.page.PageHandle;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 征信服务
 * @author liuyanlong
 *
 */
@RequestMapping("/appinfo")
@Api(value = "AppInfo",tags = "AppInfo", description = "应用系统信息")
@RestController
public class AppInfoController {
	@Autowired
	private BusinessDemoManager businessManager;
	
	@ApiOperation(value = "获取机构列表", notes = "根据任意条件查询应用列表")
	@RequestMapping(value = "appInfoQuery", method = RequestMethod.POST)
	@ResponseBody
	public PageResponse<AppInfoQueryResponse> appInfoQuery(Page inPage, AppInfoQueryRequest request) {
		//开始分页
		PageHandle.startPage(inPage);
		List<AppInfoQueryResponse> list = businessManager.demoQuery(request);
		//结束分页
		Page page = PageHandle.endPage();
		return PageResponse.build(list,page.getTotal());
	}

}
